<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/templates/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.ListInvoiceTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
        <h:form styleClass="jsfcrud_list_form">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:outputText escape="false" value="#{bundle.ListInvoiceEmpty}" rendered="#{invoiceController.items.rowCount == 0}"/>
            <h:panelGroup rendered="#{invoiceController.items.rowCount > 0}">
                <h:outputText value="#{invoiceController.pagination.pageFirstItem + 1}..#{invoiceController.pagination.pageLastItem + 1}/#{invoiceController.pagination.itemsCount}"/>&nbsp;
                <h:commandLink action="#{invoiceController.previous}" value="#{bundle.Previous} #{invoiceController.pagination.pageSize}" rendered="#{invoiceController.pagination.hasPreviousPage}"/>&nbsp;
                <h:commandLink action="#{invoiceController.next}" value="#{bundle.Next} #{invoiceController.pagination.pageSize}" rendered="#{invoiceController.pagination.hasNextPage}"/>&nbsp;
                <h:dataTable value="#{invoiceController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_id}"/>
                        </f:facet>
                        <h:outputText value="#{item.id}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_amount}"/>
                        </f:facet>
                        <h:outputText value="#{item.amount}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_dateOfIssue}"/>
                        </f:facet>
                        <h:outputText value="#{item.dateOfIssue}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_dateOfSale}"/>
                        </f:facet>
                        <h:outputText value="#{item.dateOfSale}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_termOfPayment}"/>
                        </f:facet>
                        <h:outputText value="#{item.termOfPayment}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_wayOfPayment}"/>
                        </f:facet>
                        <h:outputText value="#{item.wayOfPayment}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_totalNetPrice}"/>
                        </f:facet>
                        <h:outputText value="#{item.totalNetPrice}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_status}"/>
                        </f:facet>
                        <h:outputText value="#{item.status}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_totalGross}"/>
                        </f:facet>
                        <h:outputText value="#{item.totalGross}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_number}"/>
                        </f:facet>
                        <h:outputText value="#{item.number}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_type}"/>
                        </f:facet>
                        <h:outputText value="#{item.type}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_comments}"/>
                        </f:facet>
                        <h:outputText value="#{item.comments}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_totalVat}"/>
                        </f:facet>
                        <h:outputText value="#{item.totalVat}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_user}"/>
                        </f:facet>
                        <h:outputText value="#{item.user}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListInvoiceTitle_customer}"/>
                        </f:facet>
                        <h:outputText value="#{item.customer}"/>
                    </h:column>
                    <h:column>
                        <f:facet name="header">
                            <h:outputText value="&nbsp;"/>
                        </f:facet>
                        <h:commandLink action="#{invoiceController.prepareView}" value="#{bundle.ListInvoiceViewLink}"/>
                        <h:outputText value=" "/>
                        <h:commandLink action="#{invoiceController.prepareEdit}" value="#{bundle.ListInvoiceEditLink}"/>
                        <h:outputText value=" "/>
                        <h:commandLink action="#{invoiceController.destroy}" value="#{bundle.ListInvoiceDestroyLink}"/>
                    </h:column>
                </h:dataTable>
            </h:panelGroup>
            <br />
            <h:commandLink action="#{invoiceController.prepareCreate}" value="#{bundle.ListInvoiceCreateLink}"/>
            <br />
            <br />
            <h:link outcome="/index" value="#{bundle.ListInvoiceIndexLink}"/>
        </h:form>
        </ui:define>
    </ui:composition>

</html>
